import { apiHttp } from '../../apiHttp';
import Api from '../../../api/cvs/cvsUserController.api';
import { JsonResult, CvsUserDTO, CvsUserSearchParam, PageResult } from '../../../api/Interface';

export default {
    // 获取CVS用户信息
    getUserById: async (id: string): Promise<CvsUserDTO> => {
        const res: JsonResult = await apiHttp(Api.getUserById, {id});
        return res.data;
    },
     // 删除角色
     deleteUserById: async (id: string): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(Api.deleteUserById, {id});
        return res;
    },
    // 修改CVS用户=====>参数接口文档有误，不传id
    updateUser: async (cvsUserInfo: CvsUserDTO ): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(Api.updateUser, cvsUserInfo);
        return res;
    },
    // 添加CVS用户
    saveUser: async (cvsUserInfo: CvsUserDTO): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(Api.saveUser, cvsUserInfo);
        return res;
    },
    //获取CVS用户列表
    sysUserInsert: async (cvsUserSearchParam: CvsUserSearchParam): Promise<PageResult> => {
        const res: JsonResult = await apiHttp(Api.sysUserInsert, cvsUserSearchParam);
        return res.data;
    },
};